package com.solo.service.impl;

import com.solo.entity.User;
import com.solo.mapper.UserMapper;
import com.solo.service.UserService;
import com.solo.utils.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class UserServiceImpl implements UserService {

	private UserMapper userMapper;

	@Override
	public List<User> selectAllUser() {
		SqlSession sqlSession = MyBatisUtil.openSession();

		try {
			userMapper = sqlSession.getMapper(UserMapper.class);
			return userMapper.selectAllUser();
		} finally {
			sqlSession.commit();
			sqlSession.close();
		}
	}
}
